<template>
    <div class="container">
		<p>
			<div>npm install vue-i18n</div>
			<div>vscode插件Du-I18n，配置du-i18n.config.json</div>
			<div>配置百度在线翻译，baiduAppid和baiduSecrectKey</div>
		</p>
        <el-button @click="changeLanguage('zh')">中文</el-button>
        <el-button @click="changeLanguage('en')">英文</el-button>
        <Child></Child>
    </div>
</template>
<script>
    import Child from "./Child.vue";
    import { getCurrentInstance } from "vue";
    export default {
        components: {
            Child,
        },
        setup() {
            console.log(getCurrentInstance());
        },
        methods: {
            changeLanguage(lang) {
                this.$i18n.locale = lang; // 动态切换语言
            },
        },
    };
</script>
<style lang="less" scoped>
    .container {
    }
</style>
